
from PyQt4.QtGui import QListView
from PyQt4.QtCore import pyqtSignature
from SimpleCells.Components.List.SCListDelegate import SCListDelegate

class SCListView(QListView):
    
    def __init__(self,parent=None):
        QListView.__init__(self,parent)
        self.__delegate = SCListDelegate(self)
        #self.setItemDelegate(self.__delegate)

    @pyqtSignature("")
    def deleteSelected(self): 
        data = self.model().getData()
        keys = map(lambda idx: data.keyFromIndex(idx.row()),\
                   self.selectedIndexes())
        for key in keys: del data[key]

    def deleteAll(self):
        data = self.model().getData()
        data.setData({})

    def copy(self):
        raise NotImplementedError()
    
    def paste(self):
        raise NotImplementedError()
    
    def cut(self):
        raise NotImplementedError()
